//
//  RootViewController.m
//  UI6_限时代码2
//
//  Created by dllo on 15/11/16.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "RootViewController.h"
#import "RootView.h"
#import "SecondView.h"

@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    RootView *rootV = [[RootView alloc] initWithFrame:self.view.frame];
    [self.view addSubview:rootV];
    [rootV release];
    

    for (NSInteger i = 0; i < 21; i++) {
            SecondView *secondV = [[SecondView alloc] initWithFrame:self.view.frame];
        if (0 == i) {
            secondV.imageV.image = [UIImage imageNamed:@"image19.jpg"];
        } else if (20 == i) {
            secondV.imageV.image = [UIImage imageNamed:@"image1.jpg"];
        } else {
            NSString *fileName = [NSString stringWithFormat:@"image%ld.jpg", i];  
            secondV.imageV.image = [UIImage imageNamed:fileName];
        }
        secondV.scrollV.frame = CGRectMake(self.view.frame.size.width * i, 0, self.view.frame.size.width, self.view.frame.size.height);
        [secondV.scrollV addSubview:secondV.imageV];
        
        [rootV.scrollV addSubview:secondV];
        [secondV release];
    }
    
    
    
    

    
    
    
    
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
